/**============================================================================
 Confidential Information - Limited distribution to authorized persons only.
 This software is protected as an unpublished work under the U.S. Copyright
 Act of 1976.

 Copyright (c) 2012, BluePhoenix Solutions, Inc. All rights reserved.
 ----------------------------------------------------------------------------
 file......: DBHelper.java
 Author....: Vyacheslav Kovalyov
 Created...: 2/16/12

 Description:

 ============================================================================*/
package ru.monyag.android.vibralarm.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import ru.monyag.android.vibralarm.alarm.Alarm;

import java.util.List;

/**
 * @author Vyacheslav Kovalyov
 * @version 1.0
 */
public class DBHelper implements IStorage {

    public DBHelper(Context context) {
        this.context = context;
        openHelper = new Database(context);
    }

    public void createAlarm(Alarm alarm) {
        connect();

        closeDb();
    }

    private void connect() {
        this.db = openHelper.getWritableDatabase();
    }

    private void closeDb() {
        if (db != null && db.isOpen()) {
            db.close();
        }
    }

    private SQLiteDatabase db;
    private final Database openHelper;
    private final Context context;



    public List<Alarm> readAlarms(Alarm alarm) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public void removeAlarm(Alarm alarm) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void editAlarm(Alarm alarm) {
        //To change body of implemented methods use File | Settings | File Templates.
    }
}
